import os, signal, sys
from .backend import stock_controller

def quitGecko(signal, frame):
    # this will possibly get executed twice
    try:
        stock_controller.quitGecko()
    except:
        pass
    sys.exit()

signal.signal(signal.SIGINT, quitGecko)
signal.signal(signal.SIGTERM, quitGecko)
if sys.platform == 'win32':
    signal.signal(signal.SIGBREAK, quitGecko)

